<?php


namespace app\api\model\Video;



use think\facade\Db;
use think\Model;

class VideoGoodsRelationModel extends Model
{
    /**
     * 数据表名
     * @var string
     */
    protected $name = "video_goods_relation";

    /**
     * 根据条件查询多条
     * @param $where
     * @return array
     * @throws
     */
    public static function getVideoGoodsRelationWhereMore($where,$filed="*")
    {
        $list = Db::name('video_goods_relation')
            ->alias('vgr')
            ->join('goods g','g.id = vgr.goods_id')
            ->field($filed)
            ->where($where)
            ->select()->toArray();
        return $list;
    }

    /**
     * 统计
     * @param $where
     * @return int
     */
    public static function getVideoGoodsRelationCountWhere($where)
    {
        $count = Db::name("video_goods_relation")->where($where)->count();
        return $count;
    }

}
